<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Quick Start - Layui</title>
  <link href="layui/css/layui.css" rel="stylesheet">
</head>
<body>
  <blockquote class="layui-elem-quote">https://domain.com/docs/base.html?a=1&c=3#/user/set/id=123/</blockquote>
  <div class="layui-btn-container">
  <button type="button" class="layui-btn layui-btn-primary" id="btnDepart">分解url</button> 
  <button type="button" class="layui-btn layui-btn-blue" id="btnDevice">设备信息</button> 
  </div>
</body>
  <!-- HTML Content -->
   <!-- 更多api：https://layui.dev/docs/2/base.html#api -->
  <script src="layui/layui.js"></script>
  <script>
  // Usage
  layui.use(function(){
    var $ = layui.$;//创建$对象
    var layer = layui.layer;//创建layui的layer对象
    var url = layui.url("https://domain.com/docs/base.html?a=1&c=3#/user/set/id=123/");//分解链接，存入url值
    $('#btnDepart').on('click',function(){//添加按钮click事件
        layer.alert(layui.util.escape(JSON.stringify(url)));//弹出json格式的url字符串
    });
    
    var device = layui.device();
    $('#btnDevice').on('click',function(){//添加按钮click事件
        layer.alert(layui.util.escape(JSON.stringify(device)));//弹出json格式的url字符串
    });

  });
  </script>
</html>